home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / TrayItemSetOnEvent.au3 < prev    next >
Text File  |  2007-09-08  |  589b  |  35 lines

  1. #include <Constants.au3>
  2. #NoTrayIcon
  3.  
  4. Opt("TrayOnEventMode",1)
  5. Opt("TrayMenuMode",1)    ; Default tray menu items (Script Paused/Exit) will not be shown.
  6.  
  7. TraySetClick(16)    ; Only secondary mouse button will show the tray menu.
  8.  
  9. $infoitem = TrayCreateItem("Info")
  10. TrayItemSetOnEvent(-1,"ShowInfo")
  11.  
  12. TrayCreateItem("")
  13.  
  14. $exititem = TrayCreateItem("Exit")
  15. TrayItemSetOnEvent(-1,"ExitScript")
  16.  
  17. TraySetState()
  18.  
  19. While 1
  20.     Sleep(10)    ; Idle loop
  21. WEnd
  22.  
  23. Exit
  24.  
  25.  
  26. ; Functions
  27. Func ShowInfo()
  28.     Msgbox(0,"Info","Tray OnEvent Demo")
  29. EndFunc
  30.  
  31.  
  32. Func ExitScript()
  33.     Exit
  34. EndFunc
  35.